<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script type="module">
        import {tt} from './module.js'
        // 将js放到head中同样能娶到button 模块是后解析的
        // 模块与模块之间是独立的作用域
        console.log(tt)
    </script>
</head>
<body>
    <button>button</button>
    <script type="module">
     // 模块的运行机制是后解析 等其他全部加载完成才会执行
     // type="module" 必须加入才能识别模块
        // import { title, url } from './module.js'
        // console.log(title)
        // console.log(url) 
        import * as com from './com.js';
        console.log(com)
        console.log(com.m01.title)
        console.log(com.m02.title)
        console.log(com.m03.title)
        console.log(com.m01)
    </script>
</body>
</html>